﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web.Script.Serialization;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            JavaScriptSerializer siSerializer = new JavaScriptSerializer();
            dynamic formdata = new { sss="1",ccc="2"  };

            var json = siSerializer.Serialize(formdata);
            var d= Codeplex.Data.DynamicJson.Parse(json);


            var keys = "";var values = new List<string>();
            dynamic dobj2 = siSerializer.Deserialize<dynamic>(json);
            foreach (var key in dobj2.Keys)
            {

                keys += "," + dobj2[key];
                //values.Add(dobj2[key].);
            }

            foreach (var item in dobj2)
            {
                var ss = item.value;
            }

            Console.WriteLine(keys);
        }
 
    }
    internal class NewＭailEventArgs : EventArgs
    {
        private readonly string m_from, m_to, m_subject;
        public NewＭailEventArgs(string from, string to, string subject)
        {
            m_from = from;
            m_to = to;
            m_subject = subject;
        }
        public string From
        {
            get { return m_from; }
        }
        public string To
        {
            get { return m_to; }
        }
        public string Subject
        {
            get { return m_subject; }
        }
    }
    internal class MailManager {
        public event EventHandler<NewＭailEventArgs> NewMail;

        //第三步：  
        protected virtual void OnNewMail(NewＭailEventArgs e) {
           //var temp = Thread.VolatileRead(ref NewMail);
           // if (temp != null) temp(this, e);
        }
    }



   
}
